<script>
// #ifdef MP
	
// #endif
(function(){
		//安卓端
		function handleFontSize () {
		   // 设置网页字体为默认大小
		   WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 })
		   // 重写设置网页字体大小的事件
		   WeixinJSBridge.on('menu:setfont', function () {
		      WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 })
		   })
		 }
		// 禁止页面改变字体大小
		if (typeof WeixinJSBridge === 'object' && typeof WeixinJSBridge.invoke === 'function') {
       handleFontSize()
    } else {
       if (document.addEventListener) {
          document.addEventListener('WeixinJSBridgeReady', handleFontSize, false)
       } else if (document.attachEvent) {
          document.attachEvent('WeixinJSBridgeReady', handleFontSize)
          document.attachEvent('onWeixinJSBridgeReady', handleFontSize)
       }
    }
})()

export default {
	globalData: {
	    is_true:true,
		/** 代理客户id */
	},
	onLaunch: function() {
		console.log('App Launch');
		let that = this
		
	},
	onShow(options) {
		// 分享卡片入口场景才调用getShareParams接口获取以下参数
		// #ifdef MP
		console.log(options)
		// this.tui.toast(JSON.stringify(options))
		let that = this
		that.tui.autoUpdate()
		if(options.query.inviter_code&&that.tui.isLogin()){
			that.tui.request("api.auth.live/invBlind", "POST", {inviter_code:options.query.inviter_code}, false, false, true).then((res) => {
				console.log(res)
			}).catch((res) => {
			
			})
		}
		if(options.query.zhiboid){
			// let url = JSON.parse(decodeURIComponent(options.query.url))
			// uni.setStorageSync('zhiboUrl',options.query.url)
			// that.tui.href('/pages/zhibo/zhibo?url='+encodeURIComponent(JSON.stringify(url)))
			if(!that.tui.isLogin()){
				uni.setStorageSync('refCode', options.query.inviter_code)
				that.tui.wetLogin(1,options.query.zhiboid)
			}else{
				that.tui.getList(options.query.zhiboid)
			}
		}
		// #endif
		this.jinzhiFuzhi()
		
	},
	onUnload() {
		console.log('App load');
		let that = this
		
	},
	onHide: function() {
		console.log('App Hide');
		let that = this
		
	},
	methods:{
		jinzhiFuzhi(){
		
			// function onBridgeReady() {
			// 	WeixinJSBridge.call('hideOptionMenu');
			// }
			// if (typeof WeixinJSBridge == "undefined") {
			// 	if (document.addEventListener) {
			// 		document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
			// 	} else if (document.attachEvent) {
			// 		document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
			// 		document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
			// 	}
			// } else {
			// 	onBridgeReady();
			// }
		},
	}
};
</script>

<style>
/*每个页面公共css */
@import 'colorui/main.css';
@import 'colorui/icon.css';
@import 'style/FontStyle.css';
body{
	-webkit-text-size-adjust:none;
}
page{
	-webkit-text-size-adjust: 100% !important;
	text-size-adjust: 100% !important;
	-moz-text-size-adjust: 100% !important;
}
view,input{font-size: 26rpx;box-sizing: border-box}
.uni-center{text-align: center;}
.red{color: #eb0414;}
.font20{font-size: 22rpx;}
.bold{font-weight: bold;}
.input-class{color: #999;}
.flex,.uni-flex{display: flex;}
.flex-1,.uni-flex-item{flex: 1;}
.flex-center,.uni-flex-center{justify-content: center;}
.flex-end,.uni-flex-end{justify-content: flex-end;}
.flex-bt,.uni-flex-bt{justify-content: space-between;}
.flex-align,.uni-flex-align{align-items: center;}
.flex-line,.uni-row{display: flex;flex-wrap: wrap;align-content: space-between;}
.text_one{
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
button::after{border: none;}
/* 超出一行省略号 */
.one-omit {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
}

.two-omit {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
}
img{
	width: 100%;
}
.empty-box{text-align: center;padding-top: 360rpx;padding-bottom: 100rpx;margin: 0 auto;}
.uni-picker-container .uni-picker-action.uni-picker-action-confirm {
	    float: right;
	    color: #f20;
	}
</style>
